<pro-header></pro-header>
<nz-card>
    <div nz-row>
        <div nz-col [nzSpan]="4" style="margin-bottom: 30px;">
            <button nz-button nzType="primary" routerLink="../add">添加管理员账号</button>
        </div>
    </div>

    <nz-table #nzTable [nzAjaxData]="data" [nzPageSize]="pagesize"
              [nzPageIndex]="currentPage" [nzTotal]="total"
              (nzPageIndexChange)="getlist($event)">
        <thead nz-thead>
        <tr>
            <th nz-th><span>序号</span></th>
            <th nz-th><span>账号</span></th>
            <th nz-th><span>操作</span></th>
        </tr>
        </thead>
        <tbody nz-tbody>
        <tr nz-tbody-tr *ngFor="let item of nzTable.data;let i=index">
            <td nz-td>{{i+1}}</td>
            <td nz-td>{{item['username']}}</td>
            <td nz-td>
                <a (click)="[delAdmin(item)]">删除</a>
                <nz-divider nzType="vertical"></nz-divider>
                <a [routerLink]="['/admin/show',item.id]">权限管理</a>
                <nz-divider nzType="vertical"></nz-divider>
                <a (click)="[showModal(item.id)]">密码修改</a>
            </td>
        </tr>
        </tbody>
    </nz-table>

    <nz-modal [nzVisible]="modelVisible" nzTitle="修改密码" (nzOnOk)="submit()"
              (nzOnCancel)="closeModal()" [nzContent]="modalContent">
        <ng-template #modalContent>

            <form nz-form [formGroup]="validateForm">
                <div nz-form-item nz-row>
                    <div nz-form-label nz-col [nzSpan]="7" nzFor>
                        <label >新密码</label>
                    </div>
                    <div nz-form-control nz-col [nzSpan]="12">
                        <input nz-input formControlName="pwd" type='password' rows='1' placeHolder='请输入新密码'>
                    </div>
                </div>
            </form>
        </ng-template>
    </nz-modal>
</nz-card>
